﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using IHISCETeim.BLL;
using IHISCETeim.Library;
using IHISCETeim.Model;


namespace IHISCETeim.Web.MachineSys.UserModel
{
    public partial class USpecialCaseEdit : PageBase
    {
        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.修改 };
            }
        }

        protected override string DWZRef
        {
            get { return "USpecialCaseList"; }
        }


        /// <summary>
        /// 需要修改的用户ID
        /// </summary>
        protected int SCID
        {
            get
            {
                return GetRequestValue<int>("SCID", 0);
            }
        }

        private USpecialCaseInfo _obj;
        protected USpecialCaseInfo obj
        {
            get
            {
                if (_obj == null)
                    _obj = USpecialCaseController.GetByID(SCID);
                return _obj;
                //OMenuController.ge
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (GetRequestValue<string>("ajaxmethod", "") == "edit")
            {
                addmenu();

            }
        }

        protected void addmenu()
        {
            USpecialCaseInfo obj = Request.SerializableObject<USpecialCaseInfo>();
            // obj.UserType = 1;

          

            bool r = USpecialCaseController.Update(obj);

            // this.AddLog(Permission.新增, null, obj);

            if (r)
            {
                SuccessJson("成功修改", this.DWZRef);
            }
            else
            {
                ErrorJson("修改失败", this.DWZRef);
            }
        }
    }
}